// 封装和组织架构相关的API

// 导入 request
import request from '@/utils/request'

/**
 * @description 查询企业的部门列表
 */
export function getDepartments() {
  return request({
    method: 'GET',
    url: '/company/department'
  })
}

/**
 * @description 获取负责人列表
 * @returns
 */

export function getEmployeeSimple() {
  return request({
    method: 'GET',
    url: '/sys/user/simple'
  })
}

/**
 * @description: 新增部门

 */
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

/**
 *@description 查询部门详情
 */

export function getDepartDetail(id) {
  return request({
    method: 'GET',
    url: `/company/department/${id}`
  })
}

/**
 *@description 修改部门详情
 */

export function updateDepartDetail(data) {
  return request({
    method: 'PUT',
    url: `/company/department/${data.id}`,
    data
  })
}

export function delDepartAPI(id) {
  return request({
    method: 'DELETE',
    url: `/company/department/${id}`
  })
}
